package cn.itsource.zcn.product.service.impl;

import cn.itsource.zcn.product.domain.ProductDetail;
import cn.itsource.zcn.product.mapper.ProductDetailMapper;
import cn.itsource.zcn.product.service.IProductDetailService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Propagation;
import org.springframework.transaction.annotation.Transactional;


import java.util.List;

/**
 * (ProductDetail)表服务实现类
 *
 * @author makejava
 * @since 2021-08-30 09:20:26
 */
@Service
@Transactional(readOnly = true, propagation = Propagation.SUPPORTS)
public class ProductDetailServiceImpl implements IProductDetailService {
    @Autowired
    private ProductDetailMapper tProductDetailMapper;


    /**
     * 新增数据
     *
     * @param tProductDetail 实例对象
     */
    @Override
    @Transactional
    public void save(ProductDetail tProductDetail) {
        tProductDetailMapper.save(tProductDetail);
    }

    /**
     * 修改数据
     *
     * @param tProductDetail 实例对象
     */
    @Override
    @Transactional
    public void update(ProductDetail tProductDetail) {
        tProductDetailMapper.update(tProductDetail);
    }

    /**
     * 通过主键删除数据
     *
     * @param id 主键
     */
    @Override
    @Transactional
    public void delete(Long id) {
        tProductDetailMapper.delete(id);
    }

    /**
     * 通过ID查询单条数据
     *
     * @param id 主键
     * @return 实例对象
     */
    @Override
    public ProductDetail queryById(Long id) {
        return tProductDetailMapper.queryById(id);
    }

    /**
     * 查询多条数据
     *
     * @return 对象列表
     */
    @Override
    public List<ProductDetail> queryAll() {
        return tProductDetailMapper.queryAll();
    }


}
